package com.centronix.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the product database table.
 * 
 */
@Entity
public class Product implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int productId;

	private String code;

	private int cottonUnits;

	private String narrative;

	//bi-directional many-to-one association to ProductType
    @ManyToOne
	@JoinColumn(name="ProductTypeId")
	private ProductType productType;

	//bi-directional many-to-one association to Purchase
	@OneToMany(mappedBy="product")
	private List<Purchase> purchases;

    public Product() {
    }

	public int getProductId() {
		return this.productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getCottonUnits() {
		return this.cottonUnits;
	}

	public void setCottonUnits(int cottonUnits) {
		this.cottonUnits = cottonUnits;
	}

	public String getNarrative() {
		return this.narrative;
	}

	public void setNarrative(String narrative) {
		this.narrative = narrative;
	}

	public ProductType getProductType() {
		return this.productType;
	}

	public void setProductType(ProductType productType) {
		this.productType = productType;
	}
	
	public List<Purchase> getPurchases() {
		return this.purchases;
	}

	public void setPurchases(List<Purchase> purchases) {
		this.purchases = purchases;
	}
	
}